package openbang.chatroom.service.vo;

/**
 * 异常管理
 * 
 * 调用后台服务的一些返回值的状态定义
 * 
 * @author aibo zeng
 *
 */

public enum ExceptionEnum {
	NOT_LOGIN (1,"没有登录"),
	NOT_AUTH(2,"没有授权"),
	SYSTEM_PAUSE (3,"系统暂停");
	

	private Integer code;
	private String desc;
	
	private ExceptionEnum(Integer code,String desc) {
		this.code = code;
		this.desc = desc;
	}
	public int getCode() {
		return code;
	}
	public String getDesc(){
		return desc;
	}
	
	public static String getDesc(Integer code) {
		for(ExceptionEnum each : ExceptionEnum.values()) {
			if(each.getCode()==code)
				return each.getDesc();
		}		
		return "";
	}
}
